<?php
namespace app\tuchuang\loglic;

use app\common\loglic\Update;

class Upgrade extends Update
{
    public function config()
    {
        return true;
    }
    
    public function menu()
    {
        model('common/Menu','loglic')->unInstall('tuchuang');
        
        model('tuchuang/Install','loglic')->menu();
        
        return true;
    }
    
    public function navs()
    {
        model('common/Navs','loglic')->unInstall('tuchuang');
        
        model('tuchuang/Install','loglic')->navs();
        
        return true;
    }
    
    public function pack()
    {
        if(config('common.apply_module') != 'tuchuang'){
            return true;
        }
        
        return \daicuo\Op::write([
            'apply_name'    => '呆错图床系统',
            'apply_module'  => 'tuchuang',
            'apply_version' => '1.7.4',
            'apply_rely'    => 'attachment,user',
        ], 'common', 'config', 'system', 0, 'yes');
    }
    
    public function status()
    {
        \daicuo\Apply::updateStatus('tuchuang', 'enable');
        
        return true;
    }
}